/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: max.jianhua
 * @Last Modified time: 2020-11-20 15:21:28
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 需求计划提报(N+1) (DLR)

// 列表 /ttVsDemandPlan1/page
export const queryList = (params) => axios.post(`${SERVER.WHOLESALES}/ttVsDemandPlan1/page`, params)

// 一键提交 /ttVsDemandPlan1/done
export const submit = (params) => axios.get(`${SERVER.WHOLESALES}/ttVsDemandPlan1/done`, {
  params
})

//批量添加   /ttVsDemandPlan1/addByTemplateIds
export const saveByIds = (params) => axios.post(`${SERVER.WHOLESALES}/ttVsDemandPlan1/addByTemplateIds`, params)

// 批量删除 /ttVsDemandPlan1/delList
export const delByIds = (params) => axios.post(`${SERVER.WHOLESALES}/ttVsDemandPlan1/delList`, params)

// 查询单条 /ttVsDemandPlan1/selectOne
export const selectOne = (params) => axios.get(`${SERVER.WHOLESALES}/ttVsDemandPlan1/selectOne`, {
  params
})

// 批量修改提报信息 /ttVsDemandPlan1/edit
export const editSave = (params) => axios.post(`${SERVER.WHOLESALES}/ttVsDemandPlan1/edit`, params)

// 导出 /ttVsDemandPlan1/excel
export const exportExcel = (params) => axios.post(`${SERVER.WHOLESALES}/ttVsDemandPlan1/excel/d`, params, {
  responseType: 'blob'
});

// 本月截止提报时间 /tmBusinessPara/getDeadlineTime
export const getDeadlineTime = (params) => axios.get(`${SERVER.WHOLESALES}/tmBusinessPara/getDeadlineTime`, {
  params
})

// 提报状态查询 /ttVsDemandPlan1/checkDoneStatus
export const getStatus = (params) => axios.get(`${SERVER.WHOLESALES}/ttVsDemandPlan1/checkDoneStatus`, {
  params
})
// 车辆分页查询 /ttVsPlanTemplate/page
export const queryCarList = (params) => axios.post(`${SERVER.WHOLESALES}/ttVsPlanTemplate/page`, params)

// / 导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);
